package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPatrolCheckWorkOrderService;
import cc.comac.mom.bean.EquipPatrolCheckWorkOrder;
import cc.comac.mom.bean.EquipPatrolCheckWorkOrderBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipPatrolCheckWorkOrder")
public class EquipPatrolCheckWorkOrderController {

	@Autowired
	private EquipPatrolCheckWorkOrderService equipPatrolCheckWorkOrderService;
	
	@ApiOperation("巡检计划工单查询")
	@RequestMapping("/selectByFields")
	public ResultBean selectByFields(@RequestBody EquipPatrolCheckWorkOrderBean obj) {
		return equipPatrolCheckWorkOrderService.selectByFields(obj);
	}
	
	@ApiOperation("巡检计划工单开始执行")
	@RequestMapping("/planStartExecute")
	public ResultBean planStartExecute(@RequestBody EquipPatrolCheckWorkOrder obj) {
		return equipPatrolCheckWorkOrderService.planStartExecute(obj);
	}
	
	@ApiOperation("巡检计划工单修改执行用时")
	@RequestMapping("/updateExecuteTime")
	public ResultBean updateExecuteTime(@RequestBody EquipPatrolCheckWorkOrder obj) {
		return equipPatrolCheckWorkOrderService.updateExecuteTime(obj);
	}
	
	@ApiOperation("巡检计划工单批量删除")
	@RequestMapping("/deleteBatch")
	public ResultBean deleteBatch(@RequestBody List<Long> ids) {
		return equipPatrolCheckWorkOrderService.deleteBatch(ids);
	}
}
